package main

import "fmt"

func producer(channel chan <- int) {
	for size :=1; size <= 10; size++ {
		fmt.Println("producer", size)
		channel <- size
	}
}

func consume(channel <- chan int) {

	for size := 1; size <= 10; size++ {
		fmt.Println("consume", <- channel)
	}
}

func main() {
	fmt.Println("Week01 Channel 练习 start")

	channelDemo := make(chan int)
	go producer(channelDemo)
	go consume(channelDemo)

	// 未解决 启动后马上终止

}
